package com.cqie.hospitalescort.enums;

import lombok.Getter;

/**
 * 角色枚举
 */
@Getter
public enum RoleEnum {

    ADMIN(0, "0","ROLE_ADMIN", "管理员"),

    USER(1, "1","ROLE_USER", "用户"),

    ESCORT(2,"2", "ROLE_ESCORT", "陪诊员");

    private final int role;

    private final String roleStr;

    private final String roleName;

    private final String roleDesc;

    RoleEnum(int role, String roleStr, String roleName , String roleDesc) {
        this.role = role;
        this.roleStr = roleStr;
        this.roleName = roleName;
        this.roleDesc = roleDesc;
    }

    public static String getRoleName(int role) {
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.getRole() == role) {
                return roleEnum.getRoleName();
            }
        }
        return null;
    }

}
